package com.itheima.stock.controller;

import com.itheima.stock.service.UserService;
import com.itheima.stock.vo.req.LoginReqVo;
import com.itheima.stock.vo.resp.LoginRespVo;
import com.itheima.stock.vo.resp.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 *    定义用户访问层控制器
 */
@RestController
@RequestMapping("api")
@CrossOrigin
public class UserController_test {
    @Autowired
    private UserService userService;
    /**
     * 用户登陆功能实现
     */
    @PostMapping("/login")
    public R<LoginRespVo> login(@RequestBody LoginReqVo vo){
        R<LoginRespVo> r = this.userService.login(vo);
        return r;
    }


    //测试
//    @GetMapping("/test")
//    public String getName(){
//        return "我是个帅哥！！！";
//    }
}
